function generateStarLine(n, isBlue) {
    let line = '';
    let starClass = isBlue ? 'blue-star' : 'red-star';
    for (let i = 0; i < n; i++) {
      line += `<span class="${starClass}"></span>`;
    }
    return `<div>${line}</div>`;
  }
  
  function generateStarPattern() {
    let pattern = '';
    for (let i = 1; i <= 9; i += 2) {
      pattern += generateStarLine(i, true);
    }
    for (let i = 9; i >= 1; i -= 2) {
      pattern += generateStarLine(i, false);
    }
    return pattern;
  }
  
  document.addEventListener('DOMContentLoaded', function() {
    document.getElementById('starContainer').innerHTML = generateStarPattern();
  });